
package com.chuangan.releasetask.mapper;

import com.chuangan.releasetask.dto.StepDTO;
import com.chuangan.releasetask.dto.TaskDTO;
import com.chuangan.releasetask.pojo.TaskMaster;
import com.chuangan.releasetask.pojo.TaskStep;
import com.chuangan.releasetask.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;

/**
 * @Author: zihua
 * @Date: 2020/8/17 16:25
 * @Version 1.0
 */
@Component
public interface TaskMapper {

    void create(TaskMaster taskMaster);

    void save(TaskStep taskStep);

    List<TaskMaster> selectAuditTask();

    List<TaskMaster> selectActiveTask();

    List<StepDTO> selectAcceptedTask();

    void autoUpdate(@Param("taskID")String taskID,@Param("taskStatusCode")int taskStatusCode,@Param("preTaskStatusCode")int preTaskStatusCode);


    TaskMaster selectTaskById(String taskID);

    List<StepDTO>  selectAcceptedByAccount(@Param("taskID")String taskID,@Param("userAccount")String userAccount);

    //List<TaskDTO>  selectCommittedTask(String taskID);

    List<TaskDTO>  selectTaskCountByStatus(@Param("taskID")String taskID, @Param("processStatus")int processStatus, @Param("taskFlag")int taskFlag);

    void acceptTask(@Param("taskDTO")TaskDTO taskDTO,@Param("taskStep")TaskStep taskStep);

    void commitTask(StepDTO stepDTO);

    void taskFlag(@Param("taskID")String taskID,@Param("userAccount")String userAccount,@Param("taskFlag")int taskFlag);


    List<TaskMaster> selectTaskListedByStatus(@Param("taskStatus")int taskStatus,@Param("userAccount")String userAccount);

    List<TaskStep> selectTaskStepById(String taskID);

    void addProcessingTaskNum(String taskID);

    void addFinishedTaskNum(String taskID);

    void addUnfinishedTaskNum(String taskID);

    List<TaskMaster> searchTaskListedByCondition(String searchPara);

    List<TaskMaster> selectTaskListedByGroup(@Param("taskClass")String taskClass,@Param("orderMode") int orderMode);

    List<TaskMaster> selectTaskListedByWeight();

    void addToBlackList(@Param("taskMaster") TaskMaster taskMaster,@Param("userAccount") String userAccount);

    TaskMaster selectRepoTaskById(@Param("taskID")String taskID,@Param("userAccount") String userAccount);

    List<Map> rankingListOrders(String month);

    List<User> rankingListSpread();
}

